﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using JULONG.WEB.Library.Account;
namespace YHWE.Web.Areas.manage.Models
{
    public class manageAuthority : absAuthority
    {
        //static string RouteName = "manage_paging";
        static object LoginRouteValue = new { controller = "Home", action = "Login" };

        public manageAuthority()
        {
            this.filterModel = false;
            this.routeList.Add(new routeForFilter("*", "*")); //过滤根项目
            this.routeList.Add(new routeForFilter("Login", "Home", "manage")); //过滤本区域的登录
        }

        public override bool isAuthority(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            return AccountClass.isLogin;
        }

        public override string getRouteName()
        {
            return "manage_default";
        }

        public override object getLoginRouteValue()
        {
            return LoginRouteValue;
        }
        //登录结束后转入的url
        public override string loginOverUrl()
        {
            return "/manage";
        }

        public override void onLoginResultBegin(System.Web.Mvc.ActionExecutingContext filterContext)
        {
            //filterContext.Controller.TempData["notAuthorityInfo"] = "您需要登录！";
            //filterContext.Controller.TempData["info"] = "You need to log in to!";
        }
    }
}